﻿<%@ Page MasterPageFile="~/Site.Master" Language="C#" AutoEventWireup="true" CodeBehind="MyOrders.aspx.cs" Inherits="RabbitManage.UI.MyOrders" %>
<%@ Import Namespace="Rabbit.Logic" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    
    <section class="contact">

        <h3>订单列表:</h3>

        <%= list.Count %>个
        <br />
        <div class="DetailMenu">
            <ul id="menuOrder">
                <li><a href="/UI/MyOrders.aspx">全部(<%=AllCount %>)</a></li>
                <li><a href="/UI/MyOrders.aspx?category=<%= OrderStateShop.WaitProcess.ToDescription() %>">待处理(<%=WaitProcessCount %>)</a></li>
                <li><a href="/UI/MyOrders.aspx?category=<%= OrderStateShop.Sent.ToDescription() %>">已处理(<%=SentCount %>)</a></li>
                <li><a href="/UI/MyOrders.aspx?category=<%= OrderStateShop.Finished.ToDescription() %>">已关闭(<%=FinishedCount %>)</a></li>
            </ul>
        </div>

            
        <table>
    <asp:Repeater runat="server" ID="myRepeater" >
        <ItemTemplate>
            
            <tr>
                <td>
                    <div style="border: solid;">
                        <table>
                            <tr>
                                <td colspan="3">
                                    <%#Eval("OrderInfo.OrderedAt") %> &nbsp;&nbsp;&nbsp;&nbsp; 订单号： 
                                    <a href="/UI/OrderHistory.aspx?id=<%#Eval("OrderInfo.Id") %>"><%#Eval("OrderInfo.Id") %> </a> 
                                </td>
                                
                                <td colspan="2">
                                    <a href="ProductList.aspx"><%#Eval("CustomerInfo.Name") %></a>
                                </td>
                                
                                <td>
                                    <%#((OrderState)Eval("OrderInfo.State")).ToDescription() %>
                                </td>
                                <td>
                                    <a href="/UI/OrderPriceEdit.aspx?id=<%#Eval("OrderInfo.Id") %>" >修改价格</a>
                                </td>
                                <td>
                                    <a href="/UI/OrderSent.aspx?id=<%#Eval("OrderInfo.Id") %>" >发货</a>
                                </td>
                                <td>
                                    <a href="/Action/OrderCancel.aspx?id=<%#Eval("OrderInfo.Id") %>" >取消</a>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="3">
                                    配送地址： <%#Eval("OrderInfo.ShipTo.Province") %> <%#Eval("OrderInfo.ShipTo.City") %> <%#Eval("OrderInfo.ShipTo.Region") %> <%#Eval("OrderInfo.ShipTo.Detail") %>
                                </td>
                                
                                <td colspan="2">
                                    总价：<%#Eval("OrderInfo.FinalPrice") %>（含运费<%#Eval("OrderInfo.DiliveryPrice") %>）
                                </td>
                            </tr>
                            
                    <asp:Repeater runat="server" ID="productRepeater">
                        <ItemTemplate>
                            
                            <tr>
                                <td>
                                    <a href="ProductDetail.aspx?id=<%#Eval("Product.ProductId") %>" target="_blank" >
                                        <img alt="产品图片" width="50" src="../Images/accent.png" />
                                    </a>
                                </td>
                                <td style="width: 50px;">
                                    <%#Eval("Product.Name") %>
                                </td>
                                <td>
                                    <%#Eval("Product.PricePerUnit") %>
                                </td>
                                <td>
                                    <%#Eval("Quantity") %>
                                </td>
                                <td>
                                    <%#(decimal)Eval("Product.PricePerUnit") * (int)Eval("Quantity") %>
                                </td>
                                <td>
                                    <a href="/Action/CartItemDelete.aspx?oid=<%#Eval("Product.ProductId") %>">完结</a>
                                </td>
                            </tr>

                        </ItemTemplate>
                    </asp:Repeater>
                        </table>
                    </div>
                </td>
            </tr>
            
        </ItemTemplate>
    </asp:Repeater>
        </table>

    </section>
</asp:Content>